%!PS-Adobe-2.0 EPSF-1.2
%%Creator: Philippe Lacroute
%%Title: Argonne National Laboratory logo
%%CreationDate: 29 August 1989
%%BoundingBox: 240 380 370 520
%%DocumentFonts: Helvetica-Bold Symbol
%%EndComments

% see page 167 of the blue book (PostScript Language Tutorial and Cookbook)
% for detailed comments describing how to make circular text

/circtextdict 16 dict def
circtextdict begin

    % return half the angle spanned by a string
    /findhalfangle { % string => angle
	stringwidth pop 2 div
	2 xradius mul pi mul div 360 mul
    } def

    % draw one character and then rotate to next position (text reads cw)
    /cwplacechar { % char => -
	/char exch def
	/halfangle char findhalfangle def
	gsave
	    halfangle neg rotate
	    radius 0 translate
	    -90 rotate
	    char stringwidth pop 2 div neg 0 moveto
	    char show
	grestore
	halfangle 2 mul neg rotate
    } def

    % draw one character and then rotate to next position (text reads ccw)
    /ccwplacechar { % char => -
	/char exch def
	/halfangle char findhalfangle def
	gsave
	    halfangle rotate
	    radius ptsize fudge sub add 0 translate
	    90 rotate
	    char stringwidth pop 2 div neg 0 moveto
	    char show
	grestore
	halfangle 2 mul rotate
    } def

    /pi 3.1415923 def

end

% draw a string on a circular path in the clockwise direction
/cwcircletext { % string fontsize centerangle radius => -
    circtextdict begin
	/radius exch def
	/centerangle exch def
	/ptsize exch def
	/str exch def
	/xradius radius ptsize 4 div add def

	gsave
	    centerangle str findhalfangle add rotate
	    str {
		/charcode exch def
		( ) dup 0 charcode put cwplacechar
	    } forall
	grestore
    end
} def

% draw a string on a circular path in the counter-clockwise direction
/ccwcircletext { % string fontsize fudge centerangle radius => -
    circtextdict begin
	/radius exch def
	/centerangle exch def
	/fudge exch def    % fudge factor; set to zero and then adjust
	/ptsize exch def
	/str exch def
	/xradius radius ptsize 4 div add def

	gsave
	    centerangle str findhalfangle sub rotate
	    str {
		/charcode exch def
		( ) dup 0 charcode put ccwplacechar
	    } forall
	grestore
    end
} def

% draw the interior of the ANL logo (arrow + circle)
/drawcenter { % side width outsider insider circrad circdy => -
    gsave 
    30 dict begin
	/circdy exch def	% vertical offset for circle
	/circrad exch def	% radius of circle
	/insider exch def	% radius of turn for inside line (in arrow)
	/outsider exch def	% radius of turn for outside line (in arrow)
	/width exch def		% distance between inside and outside lines
	/side exch def		% length of one (out)side of the arrow
	/root3 3 sqrt def

	/y0 root3 6 div side mul neg def
	/y1 y0 width add def
	/y2 y1 2 mul neg def
	/y3 y2 width 3 mul 4 div add def
	/y4 y0 2 mul neg def

	/dx0 root3 4 div width mul def
	/dx1 side 2 div width root3 mul sub def
	/dx2 dx1 width root3 div add def
	/dx3 side width root3 mul sub 2 div def
	/dx4 side 2 div def

	% inside line

	width 2 div neg y1 moveto
	dx1 neg y1 0 y2 insider arcto pop pop pop pop
	0 y2 dx1 y1 insider arcto pop pop pop pop
	dx1 y1 width 2 div y1 insider arcto pop pop pop pop
	width 2 div y1 lineto

	% outside line

	width 2 div y0 lineto
	dx4 y0 0 y4 outsider arcto pop pop pop pop
	0 y4 dx3 neg y1 outsider arcto pop pop pop pop
	dx4 neg y0 dx2 y0 outsider arcto pop pop pop pop
	width 2 div neg y0 lineto

	closepath
	stroke

	% circle

	0 circdy circrad 0 360 arc closepath stroke
    end
    grestore
} def

/Helvetica-Bold findfont 10 scalefont setfont
306 448 translate
(ARGONNE    NATIONAL    LABORATORY) 10 90 55 cwcircletext
(UNIVERSITY    OF    CHICAGO) 10 3 -90 55 ccwcircletext
/Symbol findfont 10 scalefont setfont
(\267                                                            \267)
10 3 -90 55 ccwcircletext
104 18 10 1 10 -2 drawcenter


